package com.myCinema.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.myCinema.dao.impl.CategoryDaoImpl;
import com.myCinema.struts2.Action;

public class CateDeleteAction implements Action{

	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		int id = 0;
		if(request.getParameter("id")!=null && !request.getParameter("id").isEmpty())
			id = Integer.parseInt(request.getParameter("id"));
		new CategoryDaoImpl().delete(id);
		return "success";
	}

}
